﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GalleryCommon;

public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
    }

    protected void ButtonRegister_Click(object sender, EventArgs e)
    {
        Response.Redirect("Registration.aspx");
    }

    protected void ButtonLogin_Click(object sender, EventArgs e)
    {
        User user;
        if (GalleryLogic.UserLogic.UserLogin(TextBoxEmail.Text, TextBoxPassword.Text, out user))
        {
            Response.Write("sikeres bejelentkezés");
            Session["User"] = user;
            Response.Redirect("AlbumView.aspx");
        }
        else Response.Write("sikertelen bejelentkezés");
    }
}